package com.car.dal.dao.travel;

import java.util.List;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgTravel;
import com.car.util.Page;

public class TgTravelDaoImpl extends IbatisCommonDao<TgTravel, Long> implements TgTravelDao {

	public GridObj GetList(TgTravel travel, PageObj pageObj) {
		OrderObj order = new OrderObj();
		order.setDir("desc");
		order.setSort("id");
		return super.findByPage(travel, pageObj, order);
	}
	
	public Integer getTravelCountByType(TgTravel travel) {
		return this.queryForInteger("getTravelCountByType", travel);
	}
	
	public List<TgTravel> getTravelByType(TgTravel travel,Page page) {
		travel.setFirstrownum(page.getFirstrownum());
		travel.setPagesize(page.getPagesize());
		return this.queryForEntityList(TgTravel.class,"getTravelByType", travel);
	}
	
}
